package cn.fl.prjprddtlgps.service;

import cmm.mid.core.framework.page.Pager;
import cn.cmm.base.framework.exception.BaseException;
import cn.fl.preloan.condition.PrjPrdDtlGpsQueryCondition;
import cn.fl.prjprddtlgps.condition.PrjPrdDtlGpsQC;
import cn.fl.prjprddtlgps.dto.PrjPrdDtlGpsDTO;
import cn.fl.prjprddtlgps.vo.GpsAddressVO;
import cn.fl.prjprddtlgps.vo.PrjPrdDtlGpsVO;

import java.util.List;

/**
 * @Description: PRJ_PRD_DTL_GPS（重卡其他GPS） 客户端服务层接口
 * @Description: 持久层方法名称前缀：新增：insert* 删除：delete* 修改：update* 批量：batch* 查询对象：select* get* find* 查询集合：select*
 * @Description: 业务层方法名称前缀：新增：add* 删除：remove* 修改：modify* 查询对象：select* get* 批量：batch* 查询集合：search*
 */
public interface IPrjPrdDtlGpsService {
	
	/**
	 * 获取唯一对象
	 * @param id 主键
	 * @return 对象DTO
	 */
	public PrjPrdDtlGpsVO selectById(Long id)throws BaseException;
	
	/**
	 * 新增
	 * @param entity
	 * @return
	 */
    public Long add(PrjPrdDtlGpsVO entity) throws BaseException;

    /**
     * 删除
     * @param id
     * @return
     */
    public boolean removeById(Long id)throws BaseException;
    
    /**
     * 删除
     * @param ids
     * @return
     */
    public boolean removeByIds(List<Long> ids)throws BaseException;

    /**
     * 修改
     * @param entity
     * @return
     */
    public boolean modify(PrjPrdDtlGpsVO entity)throws BaseException;

	/**
	 * 修改GPS审核状态
	 * @param  audStsCd, dtlId
	 * @return
	 * @throws BaseException
	 */
	public boolean modifyGpsAudStsByDtlId(Integer audStsCd,Long dtlId) throws BaseException;

    /**
     * 分页查询所有
     * @param page
     * @return
     */
    public Pager searchListPage(Pager page)throws BaseException;
    
    public List<PrjPrdDtlGpsVO> searchList(PrjPrdDtlGpsQueryCondition condition)throws BaseException;
    
    public boolean addPrjPrdDtlGpsList(List<PrjPrdDtlGpsVO> prjPrdDtlGpsList) throws BaseException;
	
	public boolean removeByPrjDtlId(Long prjDtlId) throws BaseException;
	
	public String compareFilesIsExists() throws BaseException;
	
	public String compareFilesExists() throws BaseException;

	public boolean modifyPrjPrdDtlGpsList(List<PrjPrdDtlGpsVO> list) throws BaseException;

	/**
	 * 验证GPS卡号是否重复
	 * @param gpsCardNo GPS卡号
	 * @param prjPrdDtlId
	 * @return 0表示占用 1表示未占用 2 数据错误
	 * @throws BaseException
	 */
	public Integer checkGPSExist(String gpsCardNo,Long prjPrdDtlId)throws BaseException;

	/**
	 * 验证GPS卡号是否存在
	 * @param dtlId 产品明细id
	 * @param serialNo GPS卡序号
	 * @return
	 * @throws BaseException
	 */
	public List<PrjPrdDtlGpsVO> gpsIsExist(Long dtlId, Integer serialNo) throws BaseException;

	/**
	 * 校验数组内是否有重复数据
	 * @param array
	 * @return boolean , true-不重复， false-重复
	 * @throws BaseException
	 */
	public boolean cheakIsRepeat(String[] array) throws BaseException;

	/**
	 * 批量新增GPS数据
	 * @param gpsList
	 * @throws BaseException
	 */
	public void batchInsert(List<PrjPrdDtlGpsVO> gpsList) throws BaseException;

	/**
	 * 批量新增GPS数据（包含先删除再新增）
	 * @param gpsList
	 * @throws BaseException
	 */
	public void batchInsertWithDel(List<PrjPrdDtlGpsVO> gpsList) throws BaseException;

	public boolean deleteByIdsForCasual(List<Long> dtlIds) throws BaseException;

	/**
	 * @Author liuxiangyang
	 * @Description 获取GPS账号下设备
	 * @Date 19:30 2020/7/28
	 * @Param gpsUser gps账号 ；status：设备状态 0 未使用 1 已使用 2 全部
	 * @return
	**/
	public List<String> getGpsDevice(Long cstMgrId,String status)throws BaseException;


	public GpsAddressVO getGpsAddress(Long cstMgrId, String keyword, String flag)throws BaseException;

	/**
	 * @Author liuxiangyang
	 * @Description 获取并设置位置信息
	 * @Date 19:39 2020/7/28
	 * @Param
	 * @return
	**/
	public void setDeviceAddInfo(Long cstMgrId,List<PrjPrdDtlGpsVO> gpsList)throws BaseException;
}
